package com.yuwj.chinaa.adapter;


import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yuwj.chinaa.R;
import com.yuwj.chinaa.entity.EntityCommunityLevelMember;

import java.util.List;

/**
 * 社区等级adapter
 */
public class CommunityLevelMemberAdapter extends BaseQuickAdapter<EntityCommunityLevelMember, BaseViewHolder> {
    Context context;

    public CommunityLevelMemberAdapter(Context context, List<EntityCommunityLevelMember> datas) {
        super(R.layout.item_community_level_member, datas);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder holder, final EntityCommunityLevelMember item) {
        ImageView ivUserPhoto = holder.getView(R.id.iv_photo);
        Glide.with(context).load(item.getImg()).crossFade().error(R.mipmap.ic_asset_user_photo).into(ivUserPhoto);
        holder.setText(R.id.tv_user_id, item.getPhone()+"");
        holder.setText(R.id.tv_date, item.getDate()+"");
        holder.setText(R.id.tv_recomment_id, item.getReferee()+"");
        holder.setText(R.id.tv_profit, item.getProfit()+"");
    }

}
